<?php
use think\facade\Route;

/** 接口路由 */

// 考试分类
Route::group('admin/category', function () {
    Route::get('/list$', 			'getList'); // 考试分类列表
    Route::get('/tree$', 			'getTree'); // 考试分类树
    Route::get('/<id>/children$', 	'getChildren')->pattern(['id' => '\d+']); // 考试分类列表
    Route::post('/create$', 		'createCategory'); // 添加考试分类
    Route::put('/<id>$', 			'editCategory')->pattern(['id' => '\d+']); // 编辑考试分类
    Route::delete('/<id>$', 		'deleteCategory')->pattern(['id' => '\d+']); // 删除考试分类
})->prefix('\app\common\service\category\admin\Category@')->append(['category_type' => 3])->middleware(['adminRoute']);


Route::group('category', function (){
    Route::get('top', 'getTopList');
    Route::get('second/tree', 'getTreeStartWithSecondLevel');
})->prefix('\app\exam\service\Category@')->middleware(['withoutLogin']);